package core.report.yearReport.bean;

import com.yalu.common.Constant;

public abstract class ComparedSalesReportDataBean extends BaseExcelReportDataBean implements Comparable<ComparedSalesReportDataBean>{
	
	private double grouthRate_totalAmount;
	private double grouthRate_cost_Amount;
	private double grouthRate_cost_accomplish;
	private double grouthRate_views;
	private double grouthRate_guests;
	private double grouthRate_success_rate;
	private double grouthRate_piecesPrice;
	private double grouthRate_pieces_per_price;
	
	public abstract String getValueByIndex(int index);
	
	public abstract void setReportDataBean(SalesReportDataBean data);
	public abstract void setLastReportDataBean(SalesReportDataBean  lastData);
	public abstract SalesReportDataBean getReportDataBean();
	public abstract SalesReportDataBean getLastReportDataBean();
	
	public abstract int getFormatTypeByIndex(int index);
	

	public static ComparedSalesReportDataBean createSalesReportDataBeanByDateType(
			String dateType) {
		ComparedSalesReportDataBean bean = null;
		if (dateType.equals(Constant.LAST_WEEK_STRING)||dateType.equals(Constant.LAST_YEAR_THIS_WEEK_STRING)) {
			bean = new ComparedYearOrMonthOrWeekSalesReportDataBean();
		} else if (dateType.equals(Constant.LAST_MONTH_STRING)||dateType.equals(Constant.LAST_YEAR_THIS_MONTH_STRING)) {
			bean = new ComparedYearOrMonthOrWeekSalesReportDataBean();
		} else if (dateType.equals(Constant.LAST_YEAR_STRING)) {
			bean = new ComparedYearOrMonthOrWeekSalesReportDataBean();
		}else if (dateType.equals(Constant.LAST_YEAR_THIS_CUSTOM_STRING)) {
			bean = new ComparedCustomSalesReportDataBean();
		}
		return bean;
	}


	public Boolean getAttributeFlag() {
		return attributeFlag;
	}

	public void setAttributeFlag(Boolean attributeFlag) {
		this.attributeFlag = attributeFlag;
	}

	public SalesReportDataBean getSalesReportDataBeanProperties() {
		SalesReportDataBean bean = null;
		if(this.getReportDataBean().getName()!=null){
			bean = getReportDataBean();
		}else{
			bean = getLastReportDataBean();
		}
		return bean;
	}

	public double getGrouthRate_totalAmount() {
		return grouthRate_totalAmount;
	}

	public void setGrouthRate_totalAmount(double grouthRate_totalAmount) {
		this.grouthRate_totalAmount = grouthRate_totalAmount;
	}

	public double getGrouthRate_cost_Amount() {
		return grouthRate_cost_Amount;
	}

	public void setGrouthRate_cost_Amount(double grouthRate_cost_Amount) {
		this.grouthRate_cost_Amount = grouthRate_cost_Amount;
	}

	public double getGrouthRate_cost_accomplish() {
		return grouthRate_cost_accomplish;
	}

	public void setGrouthRate_cost_accomplish(double grouthRate_cost_accomplish) {
		this.grouthRate_cost_accomplish = grouthRate_cost_accomplish;
	}

	public double getGrouthRate_views() {
		return grouthRate_views;
	}

	public void setGrouthRate_views(double grouthRate_views) {
		this.grouthRate_views = grouthRate_views;
	}

	public double getGrouthRate_guests() {
		return grouthRate_guests;
	}

	public void setGrouthRate_guests(double grouthRate_guests) {
		this.grouthRate_guests = grouthRate_guests;
	}

	public double getGrouthRate_success_rate() {
		return grouthRate_success_rate;
	}

	public void setGrouthRate_success_rate(double grouthRate_success_rate) {
		this.grouthRate_success_rate = grouthRate_success_rate;
	}

	public double getGrouthRate_piecesPrice() {
		return grouthRate_piecesPrice;
	}

	public void setGrouthRate_piecesPrice(double grouthRate_piecesPrice) {
		this.grouthRate_piecesPrice = grouthRate_piecesPrice;
	}

	public double getGrouthRate_pieces_per_price() {
		return grouthRate_pieces_per_price;
	}

	public void setGrouthRate_pieces_per_price(double grouthRate_pieces_per_price) {
		this.grouthRate_pieces_per_price = grouthRate_pieces_per_price;
	}
	
}
